//创建横向图标的函数
var iconArr = ["focusImg/img1.png",
"focusImg/img2.png",
"focusImg/img3.png",
"focusImg/img4.png",
"focusImg/img5.png",
"focusImg/img6.png",
"focusImg/img1.png",
"focusImg/img2.png",
"focusImg/img3.png",
"focusImg/img4.png",
"focusImg/img5.png",
"focusImg/img6.png"
];
var iconTitle=["天涯明月刀","天天酷跑","英雄联盟","大话西游","天涯明月刀","天天酷跑","英雄联盟","大话西游","天涯明月刀","天天酷跑","英雄联盟","大话西游"];
for (var i = 0 ; i < iconArr.length ;i++) {
	var icon = createIcon(iconArr[i],iconTitle[i]);
	$(".b_wrap").append(icon);
}
function createIcon(imageSrc,title) {
	return $("<li class='b_list'><div class='b_imgBox'><img src=" + imageSrc + " class='b_img'/></div><div class='b_info'><span class='b_font1'>" + title + "</span><span class='b_font2'>游戏评级:</span></div><div class='b_focusBox'><button class='b_focusBtn'>关注</button></div></li>")
};


//点击关注改变颜色
$(".b_focusBtn").on("touchend",function () {
	var text = $(this).text();
	if (text == "关注") {
		$(this).css({
			backgroundColor:"#FFFFFF",
			color: "#FE786F",
			border:"1px solid #FE786F"
		});
		$(this).text("取消关注")
	}else{
		$(this).css({
			backgroundColor:"#FE786F",
			color: "#FFFFFF",
			border:"none"
		});
		$(this).text("关注")
	}
})
